home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
cprog.EXE
/
CLSCMP11.ZIP
/
COMPRESS.DOC
< prev
next >
Wrap
Text File
|
1993-07-26
|
8KB
|
235 lines
DATA COMPRESSION LIBRARY v1.10
by Matt Witzman
Copyright (C) Cedar Lake Software 1993
INTRODUCTION
------------
This data compression library uses a string recognition algorithm
to compress data (modified Lempel-Ziv-Welch). This library was
deigned for developing game software, however it could be used for
other purposes as well. Files can be compressed with 11, 12, 13,
or 14 bit table sizes and a variable size data buffer. This version now
includes run length encoding (RLE) for compressing bitmaps with
lots of blank space. This method is much faster than the LZW
compression, but it won't compress nearly as small.
This library contains two sets of object files compiled under
Borland C v3.1. One set is geared towards disk I/O and the other
is set up for uncompressing data from files to memory.
WARRANTY
--------
CEDAR LAKE SOFTWARE hereby disclaims all warranties relating to
this software, whether express or implied, including without
limitation any implied warranties of merchantability or fitness for
a particular purpose. CEDAR LAKE SOFTWARE will not be liable for
any special, incidental, consequential, indirect, or similar
damages due to loss of data or any other reason, even if CEDAR LAKE
SOFTWARE has been advised of the possibility of such damages.
CEDAR LAKE SOFTWARE's liability for any damages shall never exceed
the price paid for the license to use this software, regardless of
the form of the claim. The person using this software bears all
risk as to the quality and performance of this software.
SHAREWARE
---------
This program is distributed as "SHAREWARE". This program is
distributed at no charge for evaluation purposes ONLY. You may
share this software with anyone you choose so long as the program
is distributed in its original form with all files intact. If you
continue to use this software after 10 days of its original use you
MUST make a registration payment of $22.95 per installation to the
author or the license to use this software is revoked.
LICENSE
-------
This program is not crippled in any way. If you use this library
for developing your own software for resale you are only obligated
to pay the single registration fee, however we request that you
notify Cedar Lake Software about the product prior to release and
send us a copy of your product to verify product registration.
FILES
-----
c3filec.obj LZW File compression/decompression - Compact Model
c3filel.obj LZW File compression/decompression - Large Model
c3fileh.obj LZW File compression/decompression - Huge Model
c3memc.obj LZW Memory Decompression - Compact Model
c3meml.obj LZW Memory Decompression - Large Model
c3memh.obj LZW Memory Decompression - Huge Model
c1filec.obj RLE File compression/decompression - Compact Model
c1filel.obj RLE File compression/decompression - Large Model
c1fileh.obj RLE File compression/decompression - Huge Model
c1memc.obj RLE Memory Decompression - Compact Model
c1meml.obj RLE Memory Decompression - Large Model
c1memh.obj RLE Memory Decompression - Huge Model
compress.doc This file
c3file.h LZW Prototypes for file compression/decompression
c3mem.h LZW Prototypes for memory decompression
c1file.h RLE Prototypes for file compression/decompression
c1mem.h RLE Prototypes for memory decompression
colorbar.dat Color bars VGA data file
colorbar.cl3 LZW Compressed color bar file
colorbar.cl1 RLE Compressed color bar file
filedemo.c Demonstrates file compression/decompression
memdemo.c Demonstrates file decompression to memory
COMPILING
---------
Both versions of the object files can not be linked into the
same program because conflicts will occur. When compiling make
sure the correct object file is used to match you memory model.
Example command lines:
bcc -ml test.c c3filel.obj
bcc -mc test2.c c1memc.obj
C1FILE?.OBJ
-----------
unsigned CLSC1_Compress ( char *source, char *dest );
char *source Pathname of source file
char *dest Pathname of destination file
RETURN VALUES 0=Success 1=Error Occured
unsigned CLSC1_Decompress ( char *source, char *dest );
char *source Pathname of source file
char *dest Pathname of destination file
RETURN VALUES 0=Success 1=Error Occured
C1MEM?.OBJ
----------
unsigned CLSC1_Memdecompress ( char *source, unsigned char far *dest );
char *source Pathname of source file
unsigned char far *dest Far pointer to destination ( MAX 1 SEGMENT )
== 64k
RETURN VALUES 0=Success 1=Error Occured
C3FILE?.OBJ
-----------
unsigned CLS_Compress ( char *sourcefile, char *destfile, unsigned
char bitsize, unsigned readbuffer );
char *sourcefile Pathname of source file
char *destfile Pathname of destination file
unsigned char bitsize This must be between 11 and 14. Higher
values will give better compression but
chew up more memory.
unsigned readbuffer Size of read buffer. ( 4000-65500 )
The bigger the better.
RETURN VALUES 0= no errors 1=error occured
unsigned CLS_Decompress ( char *sourcefile, char *destfile );
char *sourcefile Pathname of source file
char *destfile Pathname of destination file
RETURN VALUES 0= no errors 1=error occured
unsigned long CLS_GetSize ( char *sourcefile );
char *sourcefile Path of source file
RETURNS LENGTH OF COMPRESSED FILE FOR ALLOCATING ARRAYS
C3MEM?.OBJ
----------
unsigned CLS_MemDecompress ( char *sourcefile, char far *dest );
char *sourcefile Path of source file
char far *dest Destination array. Single segment
allows 64k of decompression even in
huge model.
RETURN VALUES 0= success 1=error
unsigned long CLS_GetSize ( char *sourcefile );
char *sourcefile Path of source file
RETURNS LENGTH OF COMPRESSED FILE FOR ALLOCATING ARRAYS
MEMORY REQUIREMENTS
-------------------
LZW Compression:
Compression chews up a lot more memory than decompression.
Heres the formulas:
Compression Memory= 9*(1<<bitsize)+readbuffer bytes
eg. 14 bit, 64000 byte buffer = 211456 bytes of memory
Decompression Memory= 4*(1<<bitsize)
eg 14 bit = 65536 bytes.
RLE Compression:
Compression Allocates 8512 bytes for buffers.
Decompression is stream based, so extra memory will only be
required when uncompressing to memory locations.
REGISTRATION INFORMATION
------------------------
This program may be registered by sending a check or money order
for $22.95 to:
Cedar Lake Software
PO BOX 201103
Bloomington, MN, 55420-1103
Full source code will be sent for an additional $44.95.
PLEASE USE REGISTRATION FORM!
Once you are registered you will be notified when future versions
are released. I plan to add a few more compression methods in the
near future plus I am open to suggestions for new features. New
versions can be sent to registered users for $5 to cover shipping
and handling or obtained from a BBS.
Questions and comments may also be sent to the same address. I may
also be reached at the following internet addresses:
witz0004@student.tc.umn.edu
matt.witzman@f115.n282.z1.tdkt.kksys.com